<template>
  <div>
    <div class="pb bgf">
      <a-breadcrumb>
        <a-breadcrumb-item>
          <router-link to='/item/october/billlist'>票据融资</router-link>
        </a-breadcrumb-item>
        <a-breadcrumb-item>融资申请详情</a-breadcrumb-item>
      </a-breadcrumb>
      <div class="head-title mt20">{{info.projectName}}</div>
      <div class="head-content">
        <div class="fl">申请时间：<span class="date">{{info.applyTime}}</span></div>
        <div class="fr">融资金额：<span class="amount">{{info.applyAmount}}</span></div>
      </div>
    </div>
    <div class="well-layout">
      <div class="title">流程进度</div>
      <div class="hr"></div>
      <StepBox v-if="showStep" :params="{steps}" />
    </div>
  </div>
</template>
<script>
import { getDetail, postBillAccept } from '../../../assets/api/billFinancing'
import FileUp from '../../../components/FileUp'
import StepBox from '../../../components/StepBox'
import { SelectStatus } from '../../../assets/js/stepStatus'
export default {
  name: 'billDetail',
  components: {
    FileUp,
    StepBox
  },
  data () {
    return {
      showStps: false,
      formItemLayout: {
        labelCol: { span: 10 },
        wrapperCol: { span: 12 }
      },
      tipsListData: [
        '上传招标合同和融资信息，线上提交',
        '我们将在3个工作日内反馈初审结果',
        '点击同意初审反馈的融资额度和利率',
        '工作人员与您电话联系，提供补充材料进入复审',
        '复审通过后，签订融资合同',
        '在ECDS系统中把票据背书给云成保理公司',
        '全部手续完成后3个工作日放款'
      ],
      info: {},
      steps: {}
    }
  },
  mounted () {
    this.getData()
  },
  methods: {
    async getData () {
      const res = await getDetail(this.$route.query.id)
      if (res.err) {
        this.$message.error(res.error.msg)
      } else {
        this.info = res.data
        
      }
    },
    async postBillAccept (isPass) {
      this.btnLoading = true
      const res = await postBillAccept({
        isPass: isPass,
        operationId: Number(this.$route.query.id)
      })
      this.btnLoading = false
      if (res.error) {
        this.$message.error(res.error.msg)
      } else {
        this.$message.success('提交成功')
        this.getData()
      }
    }
  }
}
</script>
<style lang="less" scoped>
.head-title {
  font-size: 20px;
  color: #333;
  position: relative;
}
.head-content {
  margin-top: 20px;
  padding-bottom: 30px;
  font-size: 16px;
  color: #999;
  .date {
    color: #666;
  }
  .amount {
    font-size: 20px;
    color: #666;
  }
}
.title {
  padding: 15px 15px;
  line-height: 15px;
}
</style>
